\section{Source/DynamicArray.h}


\begin{footnotesize}\begin{alltt}
00001 \textcolor{preprocessor}{#include <stdlib.h>}
00002 \textcolor{keyword}{typedef} \textcolor{keyword}{struct}
00003 \{
00004     \textcolor{keywordtype}{void} *Array;
00005     \textcolor{keywordtype}{size\_t} ElementSize;
00006     \textcolor{keywordtype}{size\_t} ArraySize;
00007 \}DA_DynamicArray;
00008 
00009 \textcolor{comment}{/* Create a new array with InitialSize of elements and return a pointer to it */}
00010 DA_DynamicArray *DA\_NewDynamicArray(\textcolor{keywordtype}{size\_t} SizeOfElement, \textcolor{keywordtype}{size\_t} InitialSize);
00011 \textcolor{comment}{/* Free the memory used by the array */}
00012 \textcolor{keywordtype}{void} DA\_FreeArray(DA_DynamicArray *Array);
00013 
00014 \textcolor{comment}{/* This function copies the memory pointed at by Element, into the}
00015 \textcolor{comment}{    index At of Array. If the function needs to but cannot allocate more memory}
00016 \textcolor{comment}{    -1 is return, else 0 is returned.}
00017 \textcolor{comment}{*/}
00018 \textcolor{keywordtype}{int} DA\_InsertAt(DA_DynamicArray *Array, \textcolor{keywordtype}{void} *Element, \textcolor{keywordtype}{int} At);
\end{alltt}\end{footnotesize}
